#pragma once
#include "IImageData.h"

namespace ja2{ namespace sgp
{
	//! Base class for RGB based image data.
	class ImageDataRGB : public IImageData
	{
		// Typedefs
	public:
		//! Image data type.
		typedef std::unique_ptr<char[]> DataType_t;

		// Attributes
	private:
		//! Image data.
		DataType_t m_pData;
		//! Size of data.
		std::uint_least32_t m_Size;

		// Operations
	public:
		//! See base.
		virtual void blit_transparent(IDirectDrawSurfacePtr &pSurface, Rect const &SourceRect) const;
		//! See base.
		virtual void blit_shadow(IDirectDrawSurfacePtr &pSurface, Rect const &SourceRect) const;
		//! See base.
		virtual PaletteVector_t const *palette() const;
	protected:
		//! Blit the image.
		virtual void do_blit(char *pBuffer, char *pSource, std::uint_least16_t Width, std::uint_least16_t Row) const = 0;

		// Construction/Destruction
	public:
		ImageDataRGB(DataType_t &&pData, std::uint_least32_t Size);
	};
} /*sgp*/} /*ja2*/
